<%@taglib uri="http://www.ptc.com/windchill/taglib/fmt" prefix="fmt"%>
<%@taglib tagdir="/WEB-INF/tags"   prefix="wctags"%>
<%@ page import="ext.acae2.document.resource.DocResource" %>
<%@ include file="/netmarkets/jsp/components/beginWizard.jspf"%>


<fmt:setLocale value="${localeBean.locale}"/>
<fmt:setBundle basename="ext.acae2.document.resource.DocResource" />
<fmt:message var="searchDaFuECMHeader" key="<%= DocResource.SEARCH_DAFU_ECM_TITLE%>" />
<script language="JavaScript" >
function pickerCallBackFunc(objects) {
	var pickedObjectName = objects.pickedObject[0]["name"];
	var pickedObjecOid = objects.pickedObject[0]["oid"];
	var pickedObjectNumber = objects.pickedObject[0]["number"];
	window.opener.document.getElementById("ECMRecommendName").value = pickedObjectNumber;
}

</script>

<%
   String searchECMType = request.getParameter("searchECMType");
   if(searchECMType==null){
       searchECMType = (String)request.getAttribute("searchECMType");
   }
   String excludeECMType="";
   if(searchECMType.indexOf("com.acae.ECM")>-1){
      excludeECMType = "WCTYPE|wt.doc.WTDocument|com.ptc.ReferenceDocument|com.acae.ECM|com.acae.externalECM";
   }
   System.out.println("searchECMType==========="+searchECMType);
   System.out.println("------------------------------------");
   System.out.println("excludeECMType======="+excludeECMType);
   request.setAttribute("searchECMType",searchECMType);
   request.setAttribute("excludeECMType",excludeECMType);
%>


<wctags:genericPicker id="related_addDoc_link" multiSelect="false" inline="true"
        pickerCallback="pickerCallBackFunc" pickerTitle="${searchDaFuECMHeader}"
        objectType="${searchECMType}"
		excludeSubTypes="${excludeECMType}"
        componentId="CreateReferenceDoc"
        pickedAttributes="number,name"	
        customAccessController="com.ptc.windchill.enterprise.search.server.LatestVersionAccessController"
        baseWhereClause="(state.state='RELEASED')" />


<%@include file="/netmarkets/jsp/util/end.jspf" %>